///新版本 统计
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter_ahj_app/TestViewModel.dart';
import 'package:flutter_ahj_app/app/my/view/subViews/UserInfo.dart';
import 'package:flutter_ahj_app/app/NewMine/MyViewModel.dart';
import 'package:flutter_ahj_app/base/cunchu/Constant.dart';
import 'package:flutter_ahj_app/base/cunchu/UserInfoUtils.dart';
import 'package:flutter_ahj_app/base/rouleutils/RouleUtils.dart';
import 'package:flutter_ahj_app/base/utils/JUIKit/JText.dart';
import 'package:flutter_ahj_app/base/utils/ShowFiles/GetFilesPath.dart';
import 'package:flutter_ahj_app/base/utils/ShowFiles/GetImageWidget.dart';
import 'package:flutter_ahj_app/base/utils/ToastUtils.dart';
import 'package:flutter_ahj_app/base/utils/eventBus.dart';
import 'package:flutter_ahj_app/base/utils/font_utils.dart';
import 'package:flutter_ahj_app/base/utils/mTopBar.dart';
import 'package:flutter_ahj_app/base/utils/screen_util.dart';
import 'package:flutter_ahj_app/base/values/SQColor.dart';
import 'package:flutter_ahj_app/base/values/dimens.dart';

import '../../../base/basewidget/view/BaseWidget.dart';

class TjPageView extends BaseStatefulWidget {
  @override
  State<StatefulWidget> initState() {
    // TODO: implement initState
    return TJPageState();
  }
}

class TJPageState extends BaseState<TestViewModel, TjPageView> {
  List _listData = [
    "img/yhzl_1.png","img/yhzl_2.png","img/yhzl_3.png","img/yhzl_4.png","img/yhzl_5.png",
  ];
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  Widget initWidget() {
    // TODO: implement initWidget
    return new Scaffold(
      backgroundColor: SQColor.theme_Bg_color,
      appBar: PreferredSize(
        preferredSize: Size.fromHeight(50),
        child: Container(
          decoration: new BoxDecoration(
            gradient: new LinearGradient(
                begin: Alignment.topCenter,
                end: Alignment.bottomCenter, colors: [
              Color(0xFFBCD3FF),
              Color(0xFFD3E3FA)
            ]),
          ),
          child: new AppBar(
            centerTitle: true,
            elevation: 0,
            backgroundColor: Colors.transparent,
            title: JText(
              '统计',
              color: SQColor.black_333333,fontSize: 18,
            ),
          ),
        ),
      ),
      body: _bodyView(),
    );
  }
  _bodyView() {
    return SingleChildScrollView(
      child: Column(
        children: <Widget>[
          _yhView(),
          SizedBox(height: 8,),
          new Container(
            margin: EdgeInsets.fromLTRB(13, 16, 0, 0),
            child: _topView('近6个月隐患情况'),
          ),
          _contentDownView()
        ],
      ),
    );
  }


  _topView(String title) {
    return Row(
      children: [
        Container(child: Container(), height: 14, width: 3, decoration: BoxDecoration(
      color:Color(0xFF1C6DFF),
      borderRadius: BorderRadius.circular(2),
      )),
      SizedBox(width: 5,),
     Container(height: 22,child:  JText(title, fontSize: 14, color: SQColor.black_333333, fontWeight: FontWeight.w500,),)
    ],);
  }

  _yhView() {
    return Column(
      children: [
        Container(
          margin: EdgeInsets.only(left: 15, top: 15),
          child: Row(
            children: [
              Container(
                width: 3,
                height: 15,
                decoration: BoxDecoration(
                    borderRadius: new BorderRadius.all(Radius.circular(6.0)),
                    color: SQColor.theme_color),
              ),
              Container(
                margin: EdgeInsets.only(left: 5, bottom: 2),
                child: JText('隐患治理情况', color: SQColor.black_333333, fontSize: 14, fontWeight: FontWeight.w500,),
              ),
            ],
          ),
        ),
        Container(
          padding: EdgeInsets.only(left: 6, right: 6),
          child: GridView.builder(
              physics: const NeverScrollableScrollPhysics(),
              shrinkWrap: true,
              gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                  crossAxisCount: 2, childAspectRatio: 1.9),
              itemCount: 4,
              itemBuilder: (context, index) {
                return GestureDetector(
                    onTap: () {},
                    child: Container(
                      margin: EdgeInsets.only(left: 6, top: 15, right: 6),
                      child: Image.asset(
                        "img/yhzl_${index+1}.png",
                        width: Dimens.dimens50,
                        height: Dimens.dimens50,
                      ),
                    )
                );
              }),
        )
      ],
    );
  }

  _contentDownView() {
    return Container(margin: EdgeInsets.only(top: 2),child: Row(children: [
      Expanded(child: Image.asset(_listData[4], fit: BoxFit.fill,)),
    ],),);
  }
  

}
